<template>
	<view class="container">
		<view class="hxinner" v-if="row">
			<view class="yhq_dl">
				<view class="yhq_dt">
					<view class="yhq_title">{{row.type}}</view>
					<view class="yhq_txt">{{row.name}}</view>
					<view class="yhq_gz">有效期：至{{row.end}}</view>
				</view>
				<view class="yhq_dd">
					<view class="yhq_price">￥<text>{{row.price}}</text></view>
					<view class="yhq_jaz">价值</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import API from "@/common/api.js"
	export default {
		data() {
			return {
				row: ""
			}
		},
		onLoad(options) {
			var $this = this
			API.post("order/couponhexiao", {
				id: options.id
			}).then((res) => {
				if (res.code == 1) {
					if(res.data.islogin==1){
						$this.row = res.data
						API.showModal("核销成功","/pages/index/index")
					} else {
						API.showModal("请先登录","/pages/index/index")
					}
				} else {
					API.showModal(res.msg,"/pages/index/index")
				}
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.hxinner {
		padding: 40rpx 30rpx;
		background: #f7f7f7;
		overflow: hidden;
	}

	.yhq_dl {
		width: 100%;
		display: flex;
		position: relative;
		background: #fff;
		border-radius: 20rpx;
	}

	.yhq_dl:after,
	.yhq_dl:before {
		content: '';
		position: absolute;
		right: 194rpx;
		background: #f7f7f7;
		width: 24rpx;
		height: 24rpx;
		border-radius: 24rpx;
	}

	.yhq_dl:after {
		top: -12rpx;
	}

	.yhq_dl:before {
		bottom: -12rpx;
	}

	.yhq_dt {
		flex: 1;
		padding: 24rpx 30rpx;
		border-right: 2rpx #eee dashed;
	}

	.yhq_dd {
		width: 204rpx;
		text-align: center;
	}

	.yhq_title {
		font-size: 36rpx;
		font-weight: bold;
	}

	.yhq_txt {
		margin-top: 20rpx; font-size: 26rpx;
		min-height: 72rpx;
		line-height: 36rpx;
	}

	.yhq_gz {
		margin-top: 22rpx; font-size: 28rpx;
		width: 100%;
		overflow: hidden;
		color: #999;
	}

	.yhq_price {
		margin-top: 50rpx; font-weight: bold;
		color: #ff6600;
	}

	.yhq_price text {
		font-size: 44rpx;
	}

	.yhq_jaz {
		color: #666;
		margin-top: 10rpx;
	}

	.hxcontent {
		padding: 100rpx 22% 40rpx;
		overflow: hidden;
		text-align: center;
	}

	.hxmimg {
		width: 90%;
		margin: 0 auto;
	}

	.hxmtxt {
		margin-top: 40rpx;
		line-height: 48rpx;
		font-size: 28rpx;
	}
</style>